Skip to content

7.3.2 - FIlters and Paging Updates #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: infinite scroll, load more, lazy load, endless scroll, ajax load more
Requires at least: 5.0
Requires PHP: 5.6
Tested up to: 6.8
Stable tag: 7.3.1.3
Stable tag: 7.4.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -269,11 +269,21 @@ How to install Ajax Load More.

== Changelog ==

= 7.4.0 - May 25, 2025 =
* NEW: Added required updates for table layouts and paging add-on.
* NEW: Added required updates for background processing feature of the Filters add-on.
* UPDATE: Added support for iframe block editor and rendering Ajax Load More Block.
* FIX: Fixed issue with default values on archive templates adding a duplicate query param.
* FIX: Fixed issue with `load_plugin_textdomain` warning.
* FIX: Fixed potential issue with core and filters ALM blocks throwing admin error.
* Fix: Fixed PHP warning due to registering the text domain.
* UPDATE: Various code cleanup and UI updates throughout the plugin.

= 7.3.1.3 - May 15, 2025 =
* UPDATE: Various security fixes.

= 7.3.1.2 - May 11, 2025 =
* UPDATE: Revert change to fix `load_plugin_textdomain` warning. This update caused a fatal error. Sorry about that. Will fix the warning in the next release.
* HOTFIX: Revert change to fix `load_plugin_textdomain` warning. This update caused a fatal error. Sorry about that. Will fix the warning in the next release.

= 7.3.1.1 - May 10, 2025 =
* UPDATE: Various security fixes.
Expand Down Expand Up @@ -383,12 +393,10 @@ If you are using the Filters, SEO or Paging add-ons please be sure to update the
* FIX: Fixed issue with admin_footer_text hook not returning but echoing text content.
* FIX: Fixed issue with Single Posts add-on preview function. This was no longer working but it functional again.


= 6.2.0.3 - November 6, 2023 =
*HOTFIX: Fixed issue with fatal i18n error in core Ajax Load More Elementor widget causing issues with loading posts on edit screens.
*UPDATE: Improved Cache add-on checker function for increased reliability while fetching cache.


= 6.2.0.2 - November 3, 2023 =
* FIX: Fixed issue with paging URLs when using Elementor add-on with WooCommerce products and WP archive templates.
* FIX: Fixed issue with Cache and Paging add-ons throwing an error on initial page load and causing posts not to load..
Expand All @@ -402,7 +410,6 @@ add_filter( 'alm_restapi_url', function(){
= 6.2.0.1 - October 20, 2023 =
* HOTFIX: Fixed issue with speed variable when loading Ajax Load More in a SPA application or via HTTP request.


= 6.2.0 - September 27, 2023 =
* UPDATE: Added support for GA4 integration across various add-ons.
* UPDATE: Updated Shortcode builder to accept new plugin parameters for Next Page add-on.
Expand All @@ -414,12 +421,10 @@ add_filter( 'alm_restapi_url', function(){
* FIX: Fixed issue with seo_offset parameter not displaying results due to JS error.
* FIX: Various security fixes and patches.


= 6.1.0.1 - August 8, 2023 =
* HOTFIX: Fixed issue with querying data using `custom_args` parameter.
* HOTFIX: Fixed issue with querying data using the `vars` parameter.


= 6.1.0 - July 27, 2023 =

UPGRADE NOTICE:
Expand All @@ -439,17 +444,14 @@ Users who were previously using `meta_key` for custom field ordering will need t
* FIX: Attempted compatibility fix for WPML and Single Posts add-on loading incorrect language because of WPML language cookies.
* Fix: Fixed issue with broken [Results Text](https://connekthq.com/plugins/ajax-load-more/docs/results-text/)


= 6.0.1 - June 13, 2023 =
* HOTFIX: Fixed issue with Shortcode Builder JavaScript error causing issues in admin.
* HOTFIX: Fixed issue with posts_per_page="-1" unintentionally not loading any posts.


= 6.0.0 - June 11, 2023 =
* NOTICE: Ajax Load More 6.0 is a major update and includes a breaking changes with regards to the Cache add-on. Please review the information below before updating.
* NOTICE: Cache add-on < 2.0 is no longer supported by Ajax Load More. Please update to the latest version of the add-on to continue using the Cache functionality.


* NEW: Adding required functionality for the Cache 2.0 update. This introduces a new cache structure using MD5 hash for many cache URLs.
* UPDATE: Core ALM JavaScript refactoring to stremline content loading using async/await and promises.
* UPDATE: Updated WooCommerce and Elementor add-on functionality to load content in a normalized manner.
Expand All @@ -459,11 +461,9 @@ Users who were previously using `meta_key` for custom field ordering will need t
* FIX: Fixed issue with WooCommerce and Cache add-ons not working in some instances.
* FIX: Fixed issue with ACF extension and Paging add-on not getting correct amount of posts loaded.


= 5.6.0.5 - April 3, 2023 =
* HOTFIX: Fixed issue with `taxonomy_relation` parameter resolving to `AND`.


= 5.6.0.4 - March 8, 2023 =
* UPDATE: Restricting ALM ID to contain alphanumeric characters, dashes and underscores only.
* FIX: Fixed issue with Filters target parameter and the security updates in ALM 5.6.0.3
Expand Down
2 changes: 1 addition & 1 deletion admin/admin-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
function alm_is_admin_screen() {
$return = false;
$screen = get_current_screen();
if ( $screen->parent_base === 'ajax-load-more' ) {
if ( $screen && $screen->parent_base === 'ajax-load-more' ) {
$return = true;
}
return $return;
Expand Down
21 changes: 9 additions & 12 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,18 @@ function alm_transient_notification( $message = '', $transient = '', $duration =
* @since 4.0
*/
function alm_set_transient() {
$form_data = filter_input_array( INPUT_POST );
$data = filter_input_array( INPUT_POST );

if ( ! current_user_can( 'edit_theme_options' ) || ! isset( $form_data['nonce'] ) ) {
// Bail early if missing WP capabilities or nonce.
wp_die( esc_attr__( 'You don\'t belong here.', 'ajax-load-more' ) );
if ( ! current_user_can( 'edit_theme_options' ) || ! isset( $data['nonce'] ) ) {
wp_die( esc_attr__( 'You don\'t belong here.', 'ajax-load-more' ) ); // Bail early if missing WP capabilities or nonce.
}

if ( ! wp_verify_nonce( $form_data['nonce'], 'alm_repeater_nonce' ) ) {
// Verify nonce.
wp_die( esc_attr__( 'Error - unable to verify nonce, please try again.', 'ajax-load-more' ) );
if ( ! wp_verify_nonce( $data['nonce'], 'alm_repeater_nonce' ) ) {
wp_die( esc_attr__( 'Error - unable to verify nonce, please try again.', 'ajax-load-more' ) ); // Verify nonce.
}

$transient = $form_data['transient_name'];
$duration = ! isset( $form_data['duration'] ) ? 'YEAR_IN_SECONDS' : $form_data['duration'];
$transient = $data['transient_name'];
$duration = ! isset( $data['duration'] ) ? 'YEAR_IN_SECONDS' : $data['duration'];

if ( $transient ) {
set_transient( $transient, 'true', constant( $duration ) );
Expand All @@ -99,13 +97,12 @@ function alm_set_transient() {
*/
function alm_admin_menu() {
global $alm_menu_items;
$icon = ALM_ADMIN_URL . '/img/alm-icon-menu.svg';
$before_link = '<span style="display:block; border-top: 1px solid #555; padding-top: 8px;">';
$after_link = '</span>';
$style_link_icon = 'style="opacity: 0.6; font-size: 18px; height: 18px; width: 18px; position: relative; left: -2px;"';
$license_title = has_action( 'alm_pro_installed' ) ? __( 'License', 'ajax-load-more' ) : __( 'Licenses', 'ajax-load-more' );

$alm_page = add_menu_page(
add_menu_page(
'Ajax Load More',
'Ajax Load More',
apply_filters( 'alm_user_role', 'edit_theme_options' ),
Expand Down Expand Up @@ -617,7 +614,7 @@ function alm_get_tax_terms() {
echo $value; // phpcs:ignore
wp_die();
} else {
echo "<p class='warning'>No terms exist within this taxonomy</p>";
echo '<p class="warning">' . __( 'No terms exist within this taxonomy', 'ajax-load-more' ) . '</p>';
wp_die();
}
}
Expand Down
49 changes: 23 additions & 26 deletions admin/functions/licensing.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ function alm_admin_notice_errors() {
$screen = get_current_screen();
$alm_is_admin_screen = alm_is_admin_screen();

$excluded = [ 'dashboard', 'plugins', 'options-general', 'options' ];

// Exit if screen is not dashboard, plugins, settings or ALM admin.
if ( ! $alm_is_admin_screen && $screen->id !== 'dashboard' && $screen->id !== 'plugins' && $screen->id !== 'options-general' && $screen->id !== 'options' ) {
if ( ! $alm_is_admin_screen && ! in_array( $screen->id, $excluded, true ) ) {
return;
}

$class = 'notice error alm-err-notice';
$message = '';
$count = 0;

Expand All @@ -134,6 +135,7 @@ function alm_admin_notice_errors() {
if ( has_action( $addon['action'] ) ) {
$key = $addon['key'];
$status = get_option( $addon['status'] );

// Check license status.
$license_status = alm_license_check( $addon['item_id'], get_option( $key ), $status );
if ( ! isset( $status ) || empty( $status ) || $license_status !== 'valid' ) {
Expand All @@ -144,30 +146,30 @@ function alm_admin_notice_errors() {

// Print result.
if ( $count > 0 ) {
printf( '<div class="%1$s"><p>%2$s</p></div>', wp_kses_post( $class ), wp_kses_post( $message ) );
printf( '<div class="%1$s"><p>%2$s</p></div>', 'notice error alm-err-notice', wp_kses_post( $message ) );
}
}
add_action( 'admin_notices', 'alm_admin_notice_errors' );


/**
* Check the status of a license.
*
* @param string $item_id The ID of the product.
* @param string $license The actual license key.
* @param string $status The status of the license.
* @param string $status The status of the license.
* @return bool|string
* @since 2.8.3
*/
function alm_license_check( $item_id = null, $license = null, $status = null ) {
if ( ! $item_id || ! $license || ! $status ) {
return false;
}

// Get plugin transient for license status.
if ( get_transient( "alm_{$item_id}_{$license}" ) ) {
$transient = "alm_{$item_id}_{$license}";

// Transient exists.
return get_transient( "alm_{$item_id}_{$license}" );
// Get plugin transient for license status.
if ( get_transient( $transient ) ) {
return get_transient( $transient );

} else {
$api_params = [
Expand All @@ -181,7 +183,7 @@ function alm_license_check( $item_id = null, $license = null, $status = null ) {
[
'body' => $api_params,
'timeout' => 15,
'sslverify' => false,
'sslverify' => apply_filters( 'alm_licensing_sslverify', false ),
]
);
if ( is_wp_error( $response ) ) {
Expand All @@ -195,7 +197,7 @@ function alm_license_check( $item_id = null, $license = null, $status = null ) {
update_option( $status, $license_data->license );

// Set transient value to store license status.
set_transient( "alm_{$item_id}_{$license}", $license_data->license, 168 * HOUR_IN_SECONDS ); // 7 days
set_transient( $transient, $license_data->license, 168 * HOUR_IN_SECONDS ); // 7 days

// Return the status.
return $license_data->license;
Expand All @@ -209,8 +211,7 @@ function alm_license_check( $item_id = null, $license = null, $status = null ) {
* @since 5.2
*/
function alm_plugin_update_license_messages() {
$addons = alm_get_addons();
foreach ( $addons as $addon ) {
foreach ( alm_get_addons() as $addon ) {
$path = $addon['path'];
$hook = "in_plugin_update_message-{$path}/{$path}.php";
add_action( $hook, 'alm_prefix_plugin_update_message', 10, 2 );
Expand All @@ -226,9 +227,8 @@ function alm_plugin_update_license_messages() {
* @since 5.2
*/
function alm_prefix_plugin_update_message( $data, $response ) {
$addons = alm_get_addons();
$slug = $response->slug;
$version = $response->new_version;
$addons = alm_get_addons();
$slug = $response->slug;

foreach ( $addons as $key => $addon ) {
if ( $addon['path'] === $slug ) {
Expand All @@ -241,32 +241,31 @@ function alm_prefix_plugin_update_message( $data, $response ) {
$addon = $addons[ $index ];

if ( isset( $addon ) ) {
$name = '<strong>' . $addon['name'] . '</strong>';
$status = get_option( $addon['status'] );

// Expired.
if ( $status === 'expired' ) {
// Expired.
printf(
'<span style="' . esc_html( $style ) . '">%s %s</span>',
esc_html( __( 'Looks like your subscription has expired.', 'ajax-load-more' ) ),
esc_html__( 'Looks like your subscription has expired.', 'ajax-load-more' ),
wp_kses_post( __( 'Please login to your <a href="https://connekthq.com/account/" target="_blank">Account</a> to renew the license.', 'ajax-load-more' ) )
);
}

// Invalid/Inactive.
if ( $status === 'invalid' || $status === 'disabled' ) {
// Invalid/Inactive.
printf(
'<span style="' . esc_html( $style ) . '">%s %s</span>',
esc_html( __( 'Looks like your license is inactive and/or invalid.', 'ajax-load-more' ) ),
esc_html__( 'Looks like your license is inactive and/or invalid.', 'ajax-load-more' ),
wp_kses_post( __( 'Please activate the <a href="admin.php?page=ajax-load-more-licenses" target="_blank">license</a> or login to your <a href="https://connekthq.com/account/" target="_blank">Account</a> to renew the license.', 'ajax-load-more' ) )
);
}

// Deactivated.
if ( $status === 'deactivated' ) {
// Deactivated.
printf(
'<span style="' . esc_html( $style ) . '">%s %s</span>',
esc_html( __( 'Looks like your license has been deactivated.', 'ajax-load-more' ) ),
esc_html__( 'Looks like your license has been deactivated.', 'ajax-load-more' ),
wp_kses_post( __( 'Please activate the <a href="admin.php?page=ajax-load-more-licenses" target="_blank">license</a> to update.', 'ajax-load-more' ) )
);
}
Expand All @@ -281,9 +280,7 @@ function alm_prefix_plugin_update_message( $data, $response ) {
* @since 5.2
*/
function alm_plugin_row( $plugin_name ) {
$addons = alm_get_addons();
$pro_addons = alm_get_pro_addon();

$addons = alm_get_addons();
$addons = array_merge( alm_get_addons(), alm_get_pro_addon() );
foreach ( $addons as $addon ) {
if ( $plugin_name === $addon['path'] . '/' . $addon['path'] . '.php' ) {
Expand Down
2 changes: 1 addition & 1 deletion admin/includes/components/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

$alm_menu_items = $GLOBALS['alm_menu_items'];
$alm_current_page = filter_input( INPUT_GET, 'page', @FILTER_SANITIZE_STRING );
$alm_current_page = filter_input( INPUT_GET, 'page' );
?>
<header class="alm-admin-toolbar">
<a class="alm-admin-toolbar--logo" href="<?php get_admin_url(); ?>admin.php?page=ajax-load-more">
Expand Down
5 changes: 5 additions & 0 deletions admin/includes/cta/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@
</li>
</ul>
</div>
<div class="major-publishing-actions">
<a href="https://connekthq.com/about/" class="button" target="_blank">
<?php esc_html_e( 'About Connekt', 'ajax-load-more-filters' ); ?>
</a>
</div>
</div>
12 changes: 6 additions & 6 deletions admin/includes/cta/dyk.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>
</div>
<div class="major-publishing-actions">
<a target="blank" class="button button-primary" href="https://connekthq.com/plugins/ajax-load-more/add-ons/cache/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=Cache">Learn More</a>
<a target="blank" class="button" href="https://connekthq.com/plugins/ajax-load-more/add-ons/cache/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=Cache">Learn More</a>
</div>
<?php } ?>

Expand All @@ -37,7 +37,7 @@
</div>
</div>
<div class="major-publishing-actions">
<a target="blank" class="button button-primary" href="https://connekthq.com/plugins/ajax-load-more/add-ons/previous-post/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=PreviousPost">Learn More</a>
<a target="blank" class="button" href="https://connekthq.com/plugins/ajax-load-more/add-ons/previous-post/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=PreviousPost">Learn More</a>
</div>
<?php } ?>

Expand All @@ -52,7 +52,7 @@
</div>
</div>
<div class="major-publishing-actions">
<a target="blank" class="button button-primary" href="https://connekthq.com/plugins/ajax-load-more/add-ons/comments/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=Comments">Learn More</a>
<a target="blank" class="button" href="https://connekthq.com/plugins/ajax-load-more/add-ons/comments/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=Comments">Learn More</a>
</div>
<?php } ?>

Expand All @@ -67,7 +67,7 @@
</div>
</div>
<div class="major-publishing-actions">
<a target="blank" class="button button-primary" href="https://connekthq.com/plugins/ajax-load-more/add-ons/next-page/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=Next Page">Learn More</a>
<a target="blank" class="button" href="https://connekthq.com/plugins/ajax-load-more/add-ons/next-page/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=Next Page">Learn More</a>
</div>
<?php } ?>

Expand All @@ -82,7 +82,7 @@
</div>
</div>
<div class="major-publishing-actions">
<a target="blank" class="button button-primary" href="https://connekthq.com/plugins/ajax-load-more/pro/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=Pro">Learn More</a>
<a target="blank" class="button" href="https://connekthq.com/plugins/ajax-load-more/pro/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=Pro">Learn More</a>
</div>
<?php } ?>

Expand All @@ -97,7 +97,7 @@
</div>
</div>
<div class="major-publishing-actions">
<a target="blank" class="button button-primary" href="https://connekthq.com/plugins/ajax-load-more/add-ons/elementor/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=elementor">Learn More</a>
<a target="blank" class="button" href="https://connekthq.com/plugins/ajax-load-more/add-ons/elementor/?utm_source=WP%20Admin&utm_medium=ALM%20DYK&utm_campaign=elementor">Learn More</a>
</div>
<?php } ?>
</div>
Expand Down
5 changes: 1 addition & 4 deletions admin/includes/cta/resources.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@
<a target="blank" href="https://wordpress.org/plugins/ajax-load-more/"><i class="fa fa-wordpress"></i> <?php esc_attr_e( 'WordPress', 'ajax-load-more' ); ?></a>
</li>
<li>
<a target="blank" href="https://github.com/dcooney/wordpress-ajax-load-more"><i class="fa fa-github"></i> <?php esc_attr_e( 'Github', 'ajax-load-more' ); ?></a>
</li>
<li>
<a target="blank" href="http://twitter.com/ajaxloadmore"><i class="fa fa-twitter"></i> <?php esc_attr_e( 'Twitter', 'ajax-load-more' ); ?></a>
<a target="blank" href="https://github.com/ajaxloadmore/ajax-load-more"><i class="fa fa-github"></i> <?php esc_attr_e( 'Github', 'ajax-load-more' ); ?></a>
</li>
</ul>
</div>
Expand Down
Loading