Skip to content

Commit

Permalink
Compatibility for WP 6.7 and security improvements, code modernizatio…
Browse files Browse the repository at this point in the history
…n, and compatibility updates.
  • Loading branch information
ali7ali committed Nov 17, 2024
1 parent d5b460a commit 055fb82
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 232 deletions.
110 changes: 53 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,86 @@
# Alpha Price Table For Elementor

[![WP](https://img.shields.io/badge/WordPress-%E2%86%92-lightgrey.svg?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![WordPress](https://img.shields.io/badge/WordPress-%E2%86%92-lightgrey.svg?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![WordPress Plugin Downloads](https://img.shields.io/wordpress/plugin/dt/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![WordPress Plugin Last Updated](https://img.shields.io/wordpress/plugin/last-updated/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![WordPress Plugin Required PHP Version](https://img.shields.io/wordpress/plugin/required-php/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![WordPress Plugin: Required WP Version](https://img.shields.io/wordpress/plugin/wp-version/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![WordPress Plugin: Tested WP Version](https://img.shields.io/wordpress/plugin/tested/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![WordPress Plugin Rating](https://img.shields.io/wordpress/plugin/stars/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![Required PHP Version](https://img.shields.io/wordpress/plugin/required-php/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![Required WP Version](https://img.shields.io/wordpress/plugin/wp-version/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![Tested WP Version](https://img.shields.io/wordpress/plugin/tested/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![Plugin Rating](https://img.shields.io/wordpress/plugin/stars/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)
[![Plugin Version](https://img.shields.io/wordpress/plugin/v/alpha-price-table-for-elementor?style=flat-square)](https://wordpress.org/plugins/alpha-price-table-for-elementor/)

=== Alpha Price Table For Elementor ===
Alpha Price Table For Elementor is a highly customizable and feature-rich plugin that adds advanced price table widgets to Elementor, allowing you to create visually stunning # tables.

Author: ali7ali
---

Contributors: ali7ali
## Description

Tags: price-table, price, elementor, compare, table
Alpha Price Table For Elementor provides an easy way to create responsive, customizable, and modern price tables for your WordPress website. It seamlessly integrates with the Elementor Website Builder, ensuring a smooth user experience and powerful live editing capabilities.

Requires at least: 6.0
### Key Features:

Tested up to: 6.6
- Fully customizable # tables
- Icon support (before or after text)
- Responsive design with live editing
- Seamless integration with Elementor

Requires PHP: 7.4
With Elementor’s intuitive tools and our advanced widget, building beautiful and mobile-friendly price tables is easier than ever.

Stable tag: 1.0.6
---

License: GPLv3
## Demo

License URI: https://www.gnu.org/licenses/gpl-3.0.html
See the plugin in action! Check the [demo here](https://ali-ali.org/project/alpha-price-table-for-elementor/).

Alpha Price Table For Elementor is a plugin that offers premium price table features for WordPress.
---

== Description ==
This plugin offers the ability to add a highly customized price table with extended features.
## Contributing and Reporting Issues

Plugin features
We welcome your contributions to the project. You can:

- Highly customized
- Custom icon before or after the text
- Responsive Live Editing
- Submit bug reports or feature requests on GitHub: [GitHub Repository](https://github.com/ali7ali/Alpha-Price-Table-For-Elementor).
- Fork the repository and create pull requests for code improvements.

Elementor Website Builder comes with an exclusive toolset, that lets you create a truly responsive website in a whole new and visual way. From different font sizes, padding, and margin per device, to reverse column ordering, this is the most powerful mobile site builder for creating perfect responsive websites.
---

= Demo =
Check this widget demo here [here](https://ali-ali.org/project/alpha-price-table-for-elementor/).
## Support

= Contributing and reporting bugs =
For community support, visit the [WordPress.org forums](https://wordpress.org/support/plugin/alpha-price-table-for-elementor/). To report issues or suggest enhancements, submit them on [GitHub Issues](https://github.com/ali7ali/Alpha-Price-Table-For-Elementor/issues/new/choose).

You can contribute code to this plugin via GitHub: [https://github.com/ali7ali/Alpha-Price-Table-For-Elementor](https://github.com/ali7ali/Alpha-Price-Table-For-Elementor)
---

= Support =
## Installation

Use the WordPress.org forums for community support. If you spot a bug, you can of course log it on [Github](https://github.com/ali7ali/Alpha-Price-Table-For-Elementor/issues/new/choose) instead where we can act upon it more efficiently.
### Minimum Requirements

== Installation ==
- **WordPress**: 6.0 or greater
- **PHP**: 7.4 or greater
- **MySQL**: 5.0 or greater

= Minimum Requirements =
### Recommended Configuration

- WordPress 6.0 or greater
- PHP version 7.4 or greater
- MySQL version 5.0 or greater
- **PHP**: 8.1 or greater
- **MySQL**: 5.6 or greater
- **WordPress Memory Limit**: 128 MB or greater

= We recommend your host supports: =
### Installation Steps

- PHP version 8.1 or greater
- MySQL version 5.6 or greater
- WordPress Memory limit of 64 MB or greater (128 MB or higher is preferred)
1. Install the [Elementor Website Builder](https://wordpress.org/plugins/elementor/) plugin if you haven’t already.
2. From your WordPress Dashboard:
- Go to **Plugins** > **Add New**.
- Search for **Alpha Price Table For Elementor**.
- Click **Install Now** and then **Activate**.
3. Alternatively, upload the plugin manually:
- Download the plugin and upload the extracted folder to `/wp-content/plugins/` via FTP.
- Go to **Plugins** in WordPress and activate it.

= Installation =
---

First, make sure you have [Elementor Website Builder](https://wordpress.org/plugins/elementor/) plugin installed and activated.
## Upgrade Notice

Then follow these steps to install the plugin:
### Version 1.0.7

1. Log in to the WordPress Dashboard as an administrator.
2. Click the Plugins | Add New button.
3. Search for 'Alpha Price Table For Elementor' in the Search plugins field.
4. Once you see the plugin listed, click the Install Now button.
5. Click the Activate button to activate the plugin.

Manual or using sFTP install:

1. Manually or using sFTP Upload 'plugin-directory' to the '/wp-content/plugins/' directory
2. Activate the plugin through the 'Plugins' screen in WordPress

== Upgrade Notice ==

= 1.0.6 =
Security enhancements and code refactoring
- Added support for Elementor's latest version
- Enhanced PHP 8.1 compatibility
- Improved performance and security
- Bug fixes and code optimizations
4 changes: 2 additions & 2 deletions alpha-price-table-for-elementor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Alpha Price Table For Elementor
* Plugin URI: https://ali-ali.org/
* Description: Premium Price Table for WordPress.
* Version: 1.0.6
* Version: 1.0.7
* Author: Ali Ali
* Author URI: https://github.com/Ali7Ali
* Text Domain: alpha-price-table-for-elementor
Expand Down Expand Up @@ -32,7 +32,7 @@
exit; // Exit if accessed directly.
}

define('ALPHAPRICETABLE_VERSION', '1.0.6');
define('ALPHAPRICETABLE_VERSION', '1.0.7');
define('ALPHAPRICETABLE_PLUGIN_FILE', __FILE__);
define('ALPHAPRICETABLE_PLUGIN_URL', plugin_dir_url(ALPHAPRICETABLE_PLUGIN_FILE));
define('ALPHAPRICETABLE_PLUGIN_PATH', plugin_dir_path(ALPHAPRICETABLE_PLUGIN_FILE));
Expand Down
41 changes: 18 additions & 23 deletions includes/class-alpha-price-table-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@
namespace Elementor_Alpha_Price_Table_Addon;

if (!defined('ABSPATH')) {
exit; // If this file is called directly, abort.
exit; // Prevent direct access.
}

/**
* Alpha Price Table Widget.
*
* */

// Elementor Classes.

use Elementor\Widget_Base;
use Elementor\Controls_Manager;
use Elementor\Repeater;
Expand All @@ -26,12 +20,12 @@
/**
* Class Alpha_Price_Table_Widget
*
* @package Elementor
* Defines the Alpha Price Table widget for Elementor.
*/
class Alpha_Price_Table_Widget extends Widget_Base
{
/**
* Id of the widget.
* Retrieve widget name.
*
* @return string
*/
Expand All @@ -41,17 +35,17 @@ public function get_name()
}

/**
* Widget title.
* Retrieve widget title.
*
* @return string|void
* @return string
*/
public function get_title()
{
return esc_html__('Alpha Price Table', 'alpha-price-table-for-elementor');
}

/**
* Widget Icon.
* Retrieve widget icon.
*
* @return string
*/
Expand All @@ -61,20 +55,23 @@ public function get_icon()
}

/**
* Widget keywords.
* Retrieve widget keywords.
*
* @return array
*/
public function get_keywords()
{
return array('#', 'table', 'product', 'image', 'plan', 'button');
return ['#', 'table', 'plan', 'button'];
}

/**
* Register widget controls.
*
* @return void
*/
protected function register_controls()
{
// Header Section
$this->start_controls_section(
'section_header',
[
Expand Down Expand Up @@ -158,6 +155,7 @@ protected function register_controls()

$this->end_controls_section();

// Features Section
$this->start_controls_section(
'section_features',
[
Expand Down Expand Up @@ -248,6 +246,7 @@ protected function register_controls()

$this->end_controls_section();

// Footer Section
$this->start_controls_section(
'section_footer',
[
Expand Down Expand Up @@ -761,7 +760,9 @@ protected function register_controls()
}

/**
* Render the widget on the frontend.
* Render the widget output on the frontend.
*
* @return void
*/
protected function render()
{
Expand Down Expand Up @@ -795,21 +796,15 @@ protected function render()
$this->add_inline_editing_attributes('button_text');

$migration_allowed = Icons_Manager::is_migration_allowed();

// Define an allow-list for heading tags
$allowed_tags = ['h2', 'h3', 'h4', 'h5', 'h6'];

// Check if the provided tag is in the allow-list, default to 'h2' if not
$heading_tag = in_array($settings['heading_tag'], $allowed_tags) ? $settings['heading_tag'] : 'h2';
?>

<div class="elementor-price-table">
<?php if ($settings['heading'] || $settings['sub_heading']) : ?>
<div class="elementor-price-table__header">
<?php if (! empty($settings['heading'])) : ?>
<<?php echo esc_attr($heading_tag); ?> <?php echo wp_kses_post($this->get_render_attribute_string('heading')); ?>>
<<?php echo esc_attr($settings['heading_tag']); ?> <?php echo wp_kses_post($this->get_render_attribute_string('heading')); ?>>
<?php echo wp_kses_post($settings['heading']); ?>
</<?php echo esc_attr($heading_tag); ?>>
</<?php echo esc_attr($settings['heading_tag']); ?>>
<?php endif; ?>

<?php if (! empty($settings['sub_heading'])) : ?>
Expand Down
Loading

0 comments on commit 055fb82

Please # to comment.