Skip to content

Commit

Permalink
4.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelbart committed Mar 21, 2022
1 parent cb14f97 commit ceb017f
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 102 deletions.
10 changes: 8 additions & 2 deletions core/modules/class-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package Helpful
* @subpackage Core\Modules
* @version 4.5.0
* @version 4.5.5
* @since 4.3.0
*/
namespace Helpful\Core\Modules;
Expand Down Expand Up @@ -250,7 +250,7 @@ public function the_content($content)
*
* @global $post
*
* @version 4.4.59
* @version 4.5.5
* @since 4.3.0
*
* @param array $atts shortcode attributes.
Expand All @@ -272,6 +272,12 @@ public function helpful($atts, $content = '')

$options = new Services\Options();

if ('on' === $options->get_option('helpful_shortcode_post_types', 'off', 'esc_attr')) {
if (isset($post->post_type) && !in_array($post->post_type, (array) $options->get_option('helpful_post_types', [], 'esc_attr'))) {
return $content;
}
}

$defaults = Helpers\Values::get_defaults();
$defaults = apply_filters('helpful_shortcode_defaults', $defaults);

Expand Down
9 changes: 8 additions & 1 deletion core/services/class-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package Helpful
* @subpackage Core\Services
* @version 4.5.0
* @version 4.5.5
* @since 4.4.47
*/
namespace Helpful\Core\Services;
Expand Down Expand Up @@ -206,7 +206,13 @@ public function sanitize_input_without_tags($value)
return wp_kses($value, []);
}


/**
* @version 4.5.5
* @since 4.5.0
*
* @param string $group
*
* @return array
*/
public function get_defaults_array(string $group = '')
Expand Down Expand Up @@ -243,6 +249,7 @@ public function get_defaults_array(string $group = '')
'helpful_feedback_widget' => 'off',
'helpful_widget_hide_publication' => 'off',
'helpful_widget_amount' => 3,
'helpful_shortcode_post_types' => 'off',
],
'helpful-texts-settings-group' => [
'helpful_heading' => _x('Was this post helpful?', 'default headline', 'helpful'),
Expand Down
6 changes: 3 additions & 3 deletions core/tabs/class-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package Helpful
* @subpackage Core\Tabs
* @version 4.4.50
* @version 4.5.5
* @since 4.3.0
*/
namespace Helpful\Core\Tabs;
Expand Down Expand Up @@ -223,15 +223,15 @@ public function register_tab_alerts()
{
if (isset($_GET['settings-updated'])) {
$message = esc_html_x('Settings saved.', 'tab alert after save', 'helpful');
echo Helper::get_alert($message, 'success', 1500);
echo Helper::get_alert($message, 'success', 0);
}
}

/**
* Filters the values of an option before saving them. Thus does not allow every HTML element
* and makes Helpful a bit more secure.
*
* @version 4.4.57
* @version 4.5.5
* @since 4.4.57
*
* @param mixed $value
Expand Down
4 changes: 2 additions & 2 deletions core/tabs/class-export.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/**
* @package Helpful
* @subpackage Core\Tabs
* @version 4.4.50
* @since 4.3.0
* @version 4.5.5
* @since 4.5.0
*/
namespace Helpful\Core\Tabs;

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 @@ -2,7 +2,7 @@
/**
* @package Helpful
* @subpackage Core\Tabs
* @version 4.4.50
* @version 4.5.5
* @since 4.3.0
*/
namespace Helpful\Core\Tabs;
Expand Down Expand Up @@ -227,7 +227,7 @@ public function register_tab_alerts()
{
if (isset($_GET['settings-updated'])) {
$message = esc_html_x('Settings saved.', 'tab alert after save', 'helpful');
echo Helper::get_alert($message, 'success', 1500);
echo Helper::get_alert($message, 'success', 0);
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/tabs/class-log.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package Helpful
* @subpackage Core\Tabs
* @version 4.4.50
* @version 4.5.5
* @since 4.3.0
*/
namespace Helpful\Core\Tabs;
Expand Down Expand Up @@ -211,7 +211,7 @@ public function register_tab_alerts()
{
if (isset($_GET['settings-updated'])) {
$message = esc_html_x('Settings saved.', 'tab alert after save', 'helpful');
echo Helper::get_alert($message, 'success', 1500);
echo Helper::get_alert($message, 'success', 0);
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/tabs/class-start.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package Helpful
* @subpackage Core\Tabs
* @version 4.4.50
* @version 4.5.5
* @since 4.3.0
*/
namespace Helpful\Core\Tabs;
Expand Down Expand Up @@ -287,7 +287,7 @@ public function register_tab_alerts()
{
if (isset($_GET['settings-updated'])) {
$message = esc_html_x('Settings saved.', 'tab alert after save', 'helpful');
echo Helper::get_alert($message, 'success', 1500);
echo Helper::get_alert($message, 'success', 0);
}
}
}
4 changes: 2 additions & 2 deletions core/tabs/class-system.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package Helpful
* @subpackage Core\Tabs
* @version 4.4.59
* @version 4.5.5
* @since 4.3.0
*/
namespace Helpful\Core\Tabs;
Expand Down Expand Up @@ -265,7 +265,7 @@ public function register_tab_alerts()
{
if (isset($_GET['settings-updated'])) {
$message = esc_html_x('Settings saved.', 'tab alert after save', 'helpful');
echo Helper::get_alert($message, 'success', 1500);
echo Helper::get_alert($message, 'success', 0);
}
}

Expand Down
4 changes: 2 additions & 2 deletions core/tabs/class-texts.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @package Helpful
* @subpackage Core\Tabs
* @version 4.4.50
* @version 4.5.5
* @since 4.3.0
*/
namespace Helpful\Core\Tabs;
Expand Down Expand Up @@ -166,7 +166,7 @@ public function register_tab_alerts()
{
if (isset($_GET['settings-updated'])) {
$message = esc_html_x('Settings saved.', 'tab alert after save', 'helpful');
echo Helper::get_alert($message, 'success', 1500);
echo Helper::get_alert($message, 'success', 0);
}
}

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.4
* Version: 4.5.5
* 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: 5.9
Requires PHP: 5.6.20
Stable tag: 4.5.4
Stable tag: 4.5.5
License: MIT License
License URI: https://opensource.org/licenses/MIT

Expand Down
14 changes: 12 additions & 2 deletions templates/tabs/tab-details.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package Helpful
* @version 4.4.59
* @version 4.5.5
* @since 1.0.0
*/
use Helpful\Core\Helper;
Expand All @@ -23,6 +23,8 @@

<p><?php _ex('Here you can customize Helpful in detail. You can activate and deactivate many things here. Besides you can decide where Helpful appears and if Helpful appears. If you deactivate Helpful in the posts, you can output Helpful with the help of the shortcut code.', 'tab description', 'helpful'); ?></p>

<p><?php esc_html_e('Shortcode:', 'helpful'); ?> <code>[helpful]</code> | <?php esc_html_e('Dokumentation:', 'helpful'); ?> <a href="https://helpful-plugin.info/docs/getting-started/shortcodes/" target="_blank" title="<?php esc_attr_e('Open documentation in new tab', 'helpful'); ?>"><?php esc_html_e('Shortcodes', 'helpful'); ?></a></p>

<form method="post" action="<?php echo esc_url(admin_url('admin-ajax.php')); ?>">
<input type="hidden" name="option_page" value="helpful-details-settings-group">
<input type="hidden" name="action" value="helpful_update_options">
Expand Down Expand Up @@ -149,13 +151,21 @@
</label>
</div><!-- .helpful-admin-group -->

<div class="helpful-admin-group">
<div class="helpful-admin-group helpful-margin-bottom">
<label>
<?php $value = $options->get_option('helpful_wordpress_user', 'off', 'esc_attr'); ?>
<input id="helpful_wordpress_user" type="checkbox" name="helpful_wordpress_user" <?php checked('on', $value); ?> />
<?php echo esc_html_x('Use the WordPress user instead of the Helpful ID (if the user is logged in and votes).', 'label', 'helpful'); ?>
</label>
</div><!-- .helpful-admin-group -->

<div class="helpful-admin-group">
<label>
<?php $value = $options->get_option('helpful_shortcode_post_types', 'off', 'esc_attr'); ?>
<input id="helpful_shortcode_post_types" type="checkbox" name="helpful_shortcode_post_types" <?php checked('on', $value); ?> />
<?php echo esc_html_x('Respect selected post types when using the shortcode.', 'label', 'helpful'); ?>
</label>
</div><!-- .helpful-admin-group -->
</div><!-- .helpful-admin-panel-content -->
</div><!-- .helpful-admin-panel -->
<div class="helpful-admin-panel">
Expand Down
80 changes: 0 additions & 80 deletions wpml-config.xml

This file was deleted.

0 comments on commit ceb017f

Please sign in to comment.