Plugin Directory

Changeset 2713489


Ignore:
Timestamp:
04/22/2022 07:59:03 PM (4 years ago)
Author:
pluginoptimizer
Message:

Tagging version trunk

Location:
plugin-optimizer/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • plugin-optimizer/trunk/README.txt

    r2704634 r2713489  
    44Requires at least: 5.0
    55Tested up to: 5.7
    6 Stable tag: 1.3.1
     6Stable tag: 1.3.3
    77Requires PHP: 7.0
    88License: GPLv2 or later
  • plugin-optimizer/trunk/admin/class-po-admin-ajax.php

    r2679464 r2713489  
    5252
    5353    global $wpdb;
    54        
     54
    5555    if( empty( $_POST['data'] ) ){              wp_send_json_error( [ "message" => "The data never reached the server!" ] ); }
    5656   
     
    6060   
    6161    $data = SOSPO_Admin_Helper::format__save_filter_data( $array['SOSPO_filter_data'] );
    62    
    6362    // sospo_mu_plugin()->write_log( $_POST, "po_save_filter-_POST" );
    6463    // sospo_mu_plugin()->write_log( $data,  "po_save_filter-data"  );
     
    168167    }
    169168
     169   
     170    if( isset($data['meta']['frontend']) ){
     171      if( empty($data['meta']['frontend']) ){
     172        $frontend = 'false';
     173      } else {
     174        $frontend = 'true';
     175      }
     176
     177      update_post_meta( $post_id, 'frontend', $frontend );
     178
     179    }
     180
    170181    wp_send_json_success( [ "message" => "All good, the filter is saved.", "id" => $post_id, ] );
    171182
  • plugin-optimizer/trunk/admin/class-po-admin-helper.php

    r2679464 r2713489  
    925925                "categories"        => ! empty( $data["categories"] )       ? $data["categories"]       : [],
    926926                "belongs_to"        => ! empty( $data["belongs_to"] )       ? $data["belongs_to"]       : "",
     927                "frontend"          => ! empty( $data["frontend"] )         ? $data["frontend"]         : "",
    927928            ],
    928929        ];
  • plugin-optimizer/trunk/admin/js/po-admin.js

    r2679464 r2713489  
    269269        if( type == "_endpoint" || type == '_ajax'){
    270270            $('#edit_filter #endpoints_wrapper').slideDown();
     271            $('#post_type_options').hide();
    271272        } else {
    272273            $('#edit_filter #endpoints_wrapper').slideUp();
     274            $('#post_type_options').show();
    273275        }
    274276    }).change();
    275277   
    276278    // Edit Filter screen - Save filter
    277     $('#edit_filter').on('click', '#save_filter', function(){
     279    $('#edit_filter').on('click', '#save_filter', function(e){
    278280       
    279281        let filter_data = $('#edit_filter').find('select, textarea, input').serialize();
    280282       
     283
     284        if( $('#frontend_check').prop('checked')){
     285            let re = confirm("You have checked the 'Customer Facing Only' checkbox. This filter will work across all customer facing pages that use the post type "+$('#set_filter_type').val()+'. Review your filters to make sure you don\'t have unintended conficts.');
     286            if( !re ){
     287                return;
     288            }
     289            filter_data += '&frontend=true';
     290        } else {
     291            filter_data += '&frontend=false';
     292        }
     293
    281294        $.post( po_object.ajax_url, { action  : 'po_save_filter', data : filter_data }, function( response ) {
    282295            // console.log( "po_save_filter: ", response );
  • plugin-optimizer/trunk/admin/pages/page-filters-edit.php

    r2652772 r2713489  
    5151    $groups_to_block    = get_post_meta( $post->ID, "groups_used", true );
    5252    $post_categories    = get_post_meta( $post->ID, "categories", true );
     53    $frontend           = get_post_meta( $post->ID, "frontend", true);
    5354    $endpoints          = SOSPO_Admin_Helper::get_filter_endpoints( $post->ID );
    5455
     
    240241                        </div>
    241242                     </div>
     243                     <div id="post_type_options" style="margin-top:5px; <?php echo $filter_type != '_endpoint' ? '' : 'display: none;'; ?> ">
     244                        <input type="checkbox" name="SOSPO_filter_data[frontend]" value="yes" id="frontend_check" <?php echo $frontend == 'yes' ? 'checked="checked"' : ''; ?>> Use only for customer facing pages
     245                     </div>
    242246                  </div>
    243247                  <?php if( sospo_mu_plugin()->has_agent ){ ?>
  • plugin-optimizer/trunk/includes/class-po-mu.php

    r2711757 r2713489  
    332332          (SELECT `meta_value` FROM {$wpdb->prefix}postmeta WHERE `meta_key` = 'plugins_to_block' AND `post_id` = `p`.`ID`) as plugins_to_block,
    333333          (SELECT `meta_value` FROM {$wpdb->prefix}postmeta WHERE `meta_key` = 'belongs_to' AND `post_id` = `p`.`ID`) as belongsTo,
     334          (SELECT `meta_value` FROM {$wpdb->prefix}postmeta WHERE `meta_key` = 'frontend' AND `post_id` = `p`.`ID`) as frontend,
    334335          (SELECT `user_email` FROM {$wpdb->prefix}users as u WHERE `u`.`ID` = `p`.`post_author`) as author
    335336          FROM {$wpdb->prefix}posts as p WHERE `post_type`='plgnoptmzr_filter' AND `post_status` = 'publish'";
     
    471472                continue;
    472473            }
    473 
    474             if( $filter->filter_type !== '_endpoint' ){
     474           
     475            if( $filter->filter_type !== '_endpoint' && $filter->frontend == 'true' ){
    475476
    476477                $slug = str_replace('/', '', $this->current_wp_relative_url);
  • plugin-optimizer/trunk/plugin-optimizer.php

    r2704634 r2713489  
    55 * Plugin URI:        https://pluginoptimizer.com
    66 * Description:       The Most Powerful Performance Plugin for WordPress is now available for FREE.
    7  * Version:           1.3.1
     7 * Version:           1.3.3
    88 * Author:            Plugin Optimizer
    99 * Author URI:        https://pluginoptimizer.com/about/
Note: See TracChangeset for help on using the changeset viewer.