Plugin Directory

Changeset 2678714


Ignore:
Timestamp:
02/14/2022 10:09:36 PM (4 years ago)
Author:
pluginoptimizer
Message:

Tagging version trunk

Location:
plugin-optimizer/trunk
Files:
3 edited

Legend:

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

    r2652772 r2678714  
    44Requires at least: 5.0
    55Tested up to: 5.7
    6 Stable tag: 1.2.1
     6Stable tag: 1.2.0
    77Requires PHP: 7.0
    88License: GPLv2 or later
  • plugin-optimizer/trunk/includes/class-po-mu.php

    r2652772 r2678714  
    202202    function filter_active_plugins_option_value( $active_plugins ) {
    203203
    204         /*
    205         */
    206204        if( ! empty( $this->all_plugins ) ){
    207205            return $active_plugins;
     
    216214        $this->original_active_plugins  = $active_plugins;
    217215
    218         if( in_array( "plugin-optimizer-premium/plugin-optimizer-premium.php", $this->original_active_plugins ) ){
    219 
    220             $this->has_premium = true;
    221         }
    222 
    223         //if( in_array( "plugin-optimizer-agent/plugin-optimizer-agent.php", $this->original_active_plugins ) ){
    224         if( is_plugin_active("plugin-optimizer-agent/plugin-optimizer-agent.php") ){
    225 
    226             $this->has_agent = true;
    227         }
    228 
    229216        $active_plugins_on_menu_save = get_option( "active_plugins_on_menu_save" );
    230217
     
    243230        $this->blocked_plugins          = array_intersect( $this->original_active_plugins, $this->plugins_to_block );
    244231
    245 
    246         //return $this->filtered_active_plugins;
    247         return $active_plugins;
    248     }
    249 
    250     function update_worklist_if_needed(){
    251 
    252         if( $this->is_skipped === false && $this->is_being_filtered === false && ! $this->is_po_default_page ){ /* not doing anything */
    253 
    254             if( ! is_admin() ){
    255 
    256 
    257                 // TODO we need to add endpoints to the Worklist here
    258 
    259             }
    260 
    261             // $this->write_log( ( is_admin() ? "Back end" : "Front end" ) . ": " . var_export( trim( $this->current_wp_relative_url ), true ), "update_worklist_if_needed-REQUEST_URI" );
    262         }
     232        return $this->filtered_active_plugins;
    263233    }
    264234
     
    289259
    290260        return false;
    291     }
    292 
    293     function po_get_filters_exclude_premium(){
    294         global $wpdb;
    295         $main_query = "
    296         SELECT
    297           `p`.`ID`,
    298           `p`.`post_title`,
    299           (SELECT `meta_value` FROM {$wpdb->prefix}postmeta WHERE `meta_key` = 'endpoints' AND `post_id` = `p`.`ID`) as endpoints,
    300           (SELECT `meta_value` FROM {$wpdb->prefix}postmeta WHERE `meta_key` = 'filter_type' AND `post_id` = `p`.`ID`) as filter_type,
    301           (SELECT `meta_value` FROM {$wpdb->prefix}postmeta WHERE `meta_key` = 'dict_id' AND `post_id` = `p`.`ID`) as filter_id,
    302           (SELECT `meta_value` FROM {$wpdb->prefix}postmeta WHERE `meta_key` = 'plugins_to_block' AND `post_id` = `p`.`ID`) as plugins_to_block,
    303           (SELECT `meta_value` FROM {$wpdb->prefix}postmeta WHERE `meta_key` = 'belongs_to' AND `post_id` = `p`.`ID`) as belongsTo,
    304           (SELECT `user_email` FROM {$wpdb->prefix}users as u WHERE `u`.`ID` = `p`.`post_author`) as author
    305           FROM {$wpdb->prefix}posts as p
    306           JOIN {$wpdb->prefix}postmeta as pm
    307            ON pm.post_id = p.ID
    308           WHERE `p`.`post_type`='plgnoptmzr_filter'
    309           AND `p`.`post_status` = 'publish'
    310           AND `pm`.`meta_key` = 'premium_filter'
    311           AND `pm`.`meta_value` != 'true'
    312         ";
    313         $results = $wpdb->get_results($main_query);
    314         return $results;
    315261    }
    316262
     
    328274          (SELECT `user_email` FROM {$wpdb->prefix}users as u WHERE `u`.`ID` = `p`.`post_author`) as author
    329275          FROM {$wpdb->prefix}posts as p WHERE `post_type`='plgnoptmzr_filter' AND `post_status` = 'publish'";
    330         $results = $wpdb->get_results($main_query);
    331         return $results;
     276
     277        return $wpdb->get_results($main_query);
    332278    }
    333279
     
    356302                       
    357303            $block_plugins = array_diff( $this->original_active_plugins, $this->po_plugins );
    358 
    359             if( $this->has_premium ){
    360 
    361                 $filters = $this->po_get_filters();
    362 
    363             } else {
    364 
    365                 $filters = $this->po_get_filters_exclude_premium();
    366             }
     304           
     305            $filters = $this->po_get_filters();
    367306
    368307            foreach( $filters as $filter ){
     
    452391
    453392        // --- Get plugins to block from all the filters
    454         if( $this->has_premium ){
    455             $filters = $this->po_get_filters();
    456 
    457         } else {
    458 
    459             $filters = $this->po_get_filters_exclude_premium();
    460         }
     393        $filters = $this->po_get_filters();
    461394
    462395        foreach( $filters as $filter ){
     
    502435
    503436                    // Check if there's a path ex /blog or /about-us
    504                     if( !empty($parsed_endpoint['path']) && !empty($this->current_url_params)){
     437                    if( !empty($parsed_endpoint['path']) ){
    505438                       
    506439                        // Compare the paths of current url and in the filter endpoint
    507440                        if( $parsed_endpoint['path'] == $this->current_url_path ){
    508441
    509 
    510442                            // Are there query params?
    511                             if( isset($parsed_endpoint['query']) && !empty($parsed_endpoint['query']) ){
     443                            if( !empty($parsed_endpoint['query']) ){
    512444                               
    513445                                // convert endpoint params to array
     
    556488
    557489        return $this->plugins_to_block;
     490    }
     491
     492    function update_worklist_if_needed(){
     493
     494        if( $this->is_skipped === false && $this->is_being_filtered === false && ! $this->is_po_default_page ){ /* not doing anything */
     495
     496            if( ! is_admin() ){
     497
     498
     499                // TODO we need to add endpoints to the Worklist here
     500
     501            }
     502
     503            // $this->write_log( ( is_admin() ? "Back end" : "Front end" ) . ": " . var_export( trim( $this->current_wp_relative_url ), true ), "update_worklist_if_needed-REQUEST_URI" );
     504        }
    558505    }
    559506
  • plugin-optimizer/trunk/plugin-optimizer.php

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